<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from './chart.vue'
export default {
  data () {
    return {
      cdata: {
        category: [
          "0(十亿)",
          "10(十亿)",
          "20(十亿)",
          "30(十亿)",
          "40(十亿)",
          "50(十亿)",
          "60(十亿)",
          "70(十亿)",
          "80(十亿)",
          "90(十亿)",
          "100(十亿)",
          "110(十亿)",
          "120(十亿)",
          "130(十亿)",
          "140(十亿)",
          "150(十亿)",
          "160(十亿)",
          "170(十亿)",
          "180(十亿)",
          "190(十亿)",
          "200(十亿)",
        ],
        lineData: [
          0,
          15,
          40,
          23,
          27,
          37,
          21,
          28,
          11,
          28,
          36,
          15,
          42,
          6,
          36,
          32,
          21,
          31,
          24,
          3,
        ],
        barData: [
          0,
          17,
          31,
          28,
          25,
          30,
          19,
          18,
          47,
          10,
          11,
          49,
          35,
          44,
          9,
          47,
          25,
          11,
          38,
          8,
          2,
        ],
        rateData: [
          0,
          24,
          26,
          19,
          43,
          29,
          35,
          33,
          23,
          44,
          47,
          6,
          16,
          23,
          28,
          25,
          42,
          30,
          26,
          4,
          3
        ],
      }
    };
  },
  components: {
    Chart,
  },
  mounted () {
    this.setData();
  },
  methods: {
    // 根据自己的业务情况修改
    setData () {
      for (let i = 0; i < this.cdata.barData.length -1; i++) {
        let rate = this.cdata.barData[i] / this.cdata.lineData[i];
        this.cdata.rateData.push(rate.toFixed(2));
      }
    },
  }
};
</script>

<style lang="scss" scoped>
</style>